The SARTools R package which generated this report has been developped at PF2 - Institut Pasteur by M.-A. Dillies and H. Varet (). Thanks to cite H. Varet, L. Brillet-Guéguen, J.-Y. Coppee and M.-A. Dillies, SARTools: A DESeq2- and EdgeR-Based R Pipeline for Comprehensive Differential Analysis of RNA-Seq Data, PLoS One, 2016, doi: http://dx.doi.org/10.1371/journal.pone.0157022 when using this tool for any analysis published.

1 Introduction

The analyses reported in this document are part of the SARTools.edgeR.genes project. The aim is to find features that are differentially expressed between Untreated and RNAi. The statistical analysis process includes data normalization, graphical exploration of raw and normalized data, test for differential expression for each feature between the conditions, raw p-value adjustment and export of lists of features having a significant differential expression between the conditions.

The analysis is performed using the R software [1], Bioconductor [2] packages including edgeR [3] and the SARTools package developed at PF2 - Institut Pasteur. Normalization and differential analysis are carried out according to the edgeR model and package. This report comes with additional tab-delimited text files that contain lists of differentially expressed features.

For more details about the edgeR methodology, please refer to its related publications [3–6].

2 Description of raw data

The count data files and associated biological conditions are listed in the following table.

Table 1: Data files and associated biological conditions.
label files batch Treatment
Ctrl1 S2_DRSC_Untreated-1.genes.tsv Single Untreated
Ctrl3 S2_DRSC_Untreated-3.genes.tsv Paired Untreated
Ctrl4 S2_DRSC_Untreated-4.genes.tsv Paired Untreated
RNAi1 S2_DRSC_CG8144_RNAi-1.genes.tsv Single RNAi
RNAi3 S2_DRSC_CG8144_RNAi-3.genes.tsv Paired RNAi
RNAi4 S2_DRSC_CG8144_RNAi-4.genes.tsv Paired RNAi

After loading the data we first have a look at the raw data table itself. The data table contains one row per annotated feature and one column per sequenced sample. Row names of this table are feature IDs (unique identifiers). The table contains raw count values representing the number of reads that map onto the features. For this project, there are 30061 features in the count data table.

Table 2: Partial view of the count data table.
Ctrl1 Ctrl3 Ctrl4 RNAi1 RNAi3 RNAi4
FBgn0013687 1 0 0 7 0 1
FBtr0005088 10274 3376 3547 10798 3489 3754
FBtr0006151 3 0 1 3 1 1
FBtr0070000 6 3 4 6 3 3
FBtr0070002 11 1 1 7 1 0
FBtr0070003 56 14 13 62 30 35

Looking at the summary of the count table provides a basic description of these raw counts (min and max values, median, etc).

Table 3: Summary of the raw counts.
Ctrl1 Ctrl3 Ctrl4 RNAi1 RNAi3 RNAi4
Min. 0 0 0 0 0 0
1st Qu. 4 1 1 4 1 1
Median 57 22 22 63 23 24
Mean 903 301 331 846 325 365
3rd Qu. 463 147 159 473 161 179
Max. 388515 109144 136713 292751 128555 154747

Figure 1 shows the total number of mapped and counted reads for each sample. We expect total read counts to be similar within conditions, they may be different across conditions. Total counts sometimes vary widely between replicates. This may happen for several reasons, including:

  • different rRNA contamination levels between samples (even between biological replicates);
  • slight differences between library concentrations, since they may be difficult to measure with high precision.
Figure 1: Number of mapped reads per sample. Colors refer to the biological condition of the sample.

Figure 1: Number of mapped reads per sample. Colors refer to the biological condition of the sample.

Figure 2 shows the percentage of features with no read count in each sample. We expect this percentage to be similar within conditions. Features with null read counts in the 6 samples will not be taken into account for the analysis with edgeR. Here, 2118 features (7.05%) are in this situation (dashed line).

Figure 2: Percentage of features with null read counts in each sample.

Figure 2: Percentage of features with null read counts in each sample.

Figure 3 shows the distribution of read counts for each sample. For sake of readability, \(\text{log}_2(\text{counts}+1)\) are used instead of raw counts. Again we expect replicates to have similar distributions. In addition, this figure shows if read counts are preferably low, medium or high. This depends on the organisms as well as the biological conditions under consideration.

Figure 3: Density distribution of read counts.

Figure 3: Density distribution of read counts.

It may happen that one or a few features capture a high proportion of reads (up to 20% or more). This phenomenon should not influence the normalization process. The edgeR normalization has proved to be robust to this situation [7]. Anyway, we expect these high count features to be the same across replicates. They are not necessarily the same across conditions. Figure 4 and table 4 illustrate the possible presence of such high count features in the data set.

Figure 4: Percentage of reads associated with the sequence having the highest count (provided in each box on the graph) for each sample.

Figure 4: Percentage of reads associated with the sequence having the highest count (provided in each box on the graph) for each sample.

Table 4: Percentage of reads associated with the sequences having the highest counts.
Ctrl1 Ctrl3 Ctrl4 RNAi1 RNAi3 RNAi4
FBtr0088035 1.43 1.21 1.37 1.15 1.32 1.41
FBtr0345369 0.98 0.60 0.40 0.88 0.31 0.28
FBtr0346892 0.82 0.96 0.64 0.95 0.62 0.54
FBtr0346872 0.67 1.07 0.78 1.09 0.82 0.70
FBtr0111132 0.62 0.67 0.83 0.86 0.73 0.72
FBtr0085911 0.70 0.76 0.81 0.72 0.83 0.86
FBtr0083057 0.36 0.47 0.50 0.51 0.62 0.72

We may wish to assess the similarity between samples across conditions. A pairwise scatter plot is produced (figure 5) to show how replicates and samples from different biological conditions are similar or different (\(\text{log}_2(\text{counts}+1)\) are used instead of raw count values). Moreover, as the Pearson correlation has been shown not to be relevant to measure the similarity between replicates, the SERE statistic has been proposed as a similarity index between RNA-Seq samples [8]. It measures whether the variability between samples is random Poisson variability or higher. Pairwise SERE values are printed in the lower triangle of the pairwise scatter plot. The value of the SERE statistic is:

  • 0 when samples are identical (no variability at all: this may happen in the case of a sample duplication);

  • 1 for technical replicates (technical variability follows a Poisson distribution);

  • greater than 1 for biological replicates and samples from different biological conditions (biological variability is higher than technical one, data are over-dispersed with respect to Poisson). The higher the SERE value, the lower the similarity. It is expected to be lower between biological replicates than between samples of different biological conditions. Hence, the SERE statistic can be used to detect inversions between samples.

Figure 5: Pairwise comparison of samples (not produced when more than 30 samples).

Figure 5: Pairwise comparison of samples (not produced when more than 30 samples).

3 Filtering low counts

edgeR suggests to filter features with null or low counts because they do not supply much information. For this project, 12154 features (40.43%) have been removed from the analysis because they did not satisfy the following condition: having at least 1 counts-per-million in at least 3 samples.

4 Variability within the experiment: data exploration

The main variability within the experiment is expected to come from biological differences between the samples. This can be checked in two ways. The first one is to perform a hierarchical clustering of the whole sample set. This is performed after a transformation of the count data as moderated log-counts-per-million. Figure 6 shows the dendrogram obtained from CPM data. An euclidean distance is computed between samples, and the dendrogram is built upon the Ward criterion. We expect this dendrogram to group replicates and separate biological conditions.

Figure 6: Sample clustering based on normalized data.

Figure 6: Sample clustering based on normalized data.

Another way of visualizing the experiment variability is to look at the first two dimensions of a multidimensional scaling plot, as shown on figure 7. On this figure, the first dimension is expected to separate samples from the different biological conditions, meaning that the biological variability is the main source of variance in the data.

Figure 7: Multidimensional scaling plot of the samples.

Figure 7: Multidimensional scaling plot of the samples.

5 Normalization

Normalization aims at correcting systematic technical biases in the data, in order to make read counts comparable across samples. The normalization proposed by edgeR is called Trimmed Mean of M-values (TMM) but it is also possible to use the RLE (DESeq) or upperquartile normalizations. It relies on the hypothesis that most features are not differentially expressed.

edgeR computes a factor for each sample. These normalization factors apply to the total number of counts and cannot be used to normalize read counts in a direct manner. Indeed, normalization factors are used to normalize total counts. These in turn are used to normalize read counts according to a total count normalization: if \(N_j\) is the total number of reads of the sample \(j\) and \(f_j\) its normalization factor, \(N'_j=f_j \times N_j\) is the normalized total number of reads. Then, let \(s_j=N'_j/\bar{N'}\) with \(\bar{N'}\) the mean of the \(N'_j\) s. Finally, the normalized counts of the sample \(j\) are defined as \(x'_{ij}=x_{ij}/s_j\) where \(i\) is the gene index.

Table 5: Normalization factors.
Ctrl1 Ctrl3 Ctrl4 RNAi1 RNAi3 RNAi4
TMM normalization factors 0.97 1.01 0.98 1.03 1.01 1.01

Boxplots are often used to assess the quality of the normalization process, as they show how distributions are globally affected during this process. We expect normalization to stabilize distributions across samples. Figure 8 shows boxplots of raw (left) and normalized (right) data respectively.

Figure 8: Boxplots of raw (left) and normalized (right) read counts.

Figure 8: Boxplots of raw (left) and normalized (right) read counts.

6 Differential analysis

6.1 Modelization

edgeR aims at fitting one linear model per feature. For this project, the design used is ~ Treatment and the goal is to estimate the models’ coefficients which can be interpreted as \(\log_2(\texttt{FC})\). These coefficients will then be tested to get p-values and adjusted p-values.

6.2 Dispersions estimation

The edgeR model assumes that the count data follow a negative binomial distribution which is a robust alternative to the Poisson law when data are over-dispersed (the variance is higher than the mean). The first step of the statistical procedure is to estimate the dispersion of the data.

Figure 9: Dispersion estimates.

Figure 9: Dispersion estimates.

Figure 9 shows the result of the dispersion estimation step. The x- and y-axes represent the mean count value and the estimated dispersion respectively. Black dots represent empirical dispersion estimates for each feature (from the observed count values). The blue curve shows the relationship between the means of the counts and the dispersions modeled with splines. The red segment represents the common dispersion.

6.3 Statistical test for differential expression

Once the dispersion estimation and the model fitting have been done, edgeR can perform the statistical testing. Figure 10 shows the distributions of raw p-values computed by the statistical test for the comparison(s) done. This distribution is expected to be a mixture of a uniform distribution on \([0,1]\) and a peak around 0 corresponding to the differentially expressed features.

Figure 10: Distribution(s) of raw p-values.

Figure 10: Distribution(s) of raw p-values.

6.4 Final results

A p-value adjustment is performed to take into account multiple testing and control the false positive rate to a chosen level \(\alpha\). For this analysis, a BH p-value adjustment was performed [9,10] and the level of controlled false positive rate was set to 0.05.

Table 6: Number of up-, down- and total number of differentially expressed features for each comparison.
Test vs Ref # down # up # total
RNAi vs Untreated 263 232 495

Figure 11 represents the MA-plot of the data for the comparisons done, where differentially expressed features are highlighted in red. A MA-plot represents the log ratio of differential expression as a function of the mean intensity for each feature. Triangles correspond to features having a too low/high \(\log_2(\text{FC})\) to be displayed on the plot.

Figure 11: MA-plot(s) of each comparison. Red dots represent significantly differentially expressed features.

Figure 11: MA-plot(s) of each comparison. Red dots represent significantly differentially expressed features.

Figure 12 shows the volcano plots for the comparisons performed and differentially expressed features are still highlighted in red. A volcano plot represents the log of the adjusted P value as a function of the log ratio of differential expression.

Figure 12: Volcano plot(s) of each comparison. Red dots represent significantly differentially expressed features.

Figure 12: Volcano plot(s) of each comparison. Red dots represent significantly differentially expressed features.

Full results as well as lists of differentially expressed features are provided in the following text files which can be easily read in a spreadsheet. For each comparison:

  • TestVsRef.complete.txt contains results for all the features;
  • TestVsRef.up.txt contains results for up-regulated features. Features are ordered from the most significant adjusted p-value to the less significant one;
  • TestVsRef.down.txt contains results for down-regulated features. Features are ordered from the most significant adjusted p-value to the less significant one.

These files contain the following columns:

  • Id: unique feature identifier;
  • sampleName: raw counts per sample;
  • norm.sampleName: rounded normalized counts per sample;
  • baseMean: base mean over all samples;
  • Untreated and RNAi: means (rounded) of normalized counts of the biological conditions;
  • FoldChange: fold change of expression, calculated as \(2^{\log_2(\text{FC})}\);
  • log2FoldChange: \(\log_2(\text{FC})\) as estimated by the GLM model. It reflects the differential expression between Test and Ref and can be interpreted as \(\log_2(\frac{\text{Test}}{\text{Ref}})\). If this value is:
    • around 0: the feature expression is similar in both conditions;
    • positive: the feature is up-regulated (\(\text{Test} > \text{Ref}\));
    • negative: the feature is down-regulated (\(\text{Test} < \text{Ref}\));
  • pvalue: raw p-value from the statistical test;
  • padj: adjusted p-value on which the cut-off \(\alpha\) is applied;
  • tagwise.dispersion: dispersion parameter estimated from feature counts (i.e. black dots on figure 9);
  • trended.dispersion: dispersion parameter estimated with splines (i.e. blue curve on figure 9).

7 R session information and parameters

The versions of the R software and Bioconductor packages used for this analysis are listed below. It is important to save them if one wants to re-perform the analysis in the same conditions.

  • R version 3.6.3 (2020-02-29), x86_64-apple-darwin15.6.0
  • Locale: en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
  • Running under: macOS Catalina 10.15.2
  • Matrix products: default
  • BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
  • LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
  • Base packages: base, datasets, graphics, grDevices, methods, parallel, stats, stats4, utils
  • Other packages: Biobase 2.46.0, BiocGenerics 0.32.0, BiocManager 1.30.10, BiocParallel 1.20.1, DelayedArray 0.12.2, DESeq2 1.26.0, devtools 2.2.2, dplyr 0.8.5, edgeR 3.28.1, forcats 0.5.0, genefilter 1.68.0, GenomeInfoDb 1.22.1, GenomicRanges 1.38.0, ggplot2 3.3.0, IRanges 2.20.2, limma 3.42.2, matrixStats 0.56.0, purrr 0.3.3, readr 1.3.1, S4Vectors 0.24.3, SARTools 1.6.6, stringr 1.4.0, SummarizedExperiment 1.16.1, tibble 3.0.0, tidyr 1.0.2, tidyverse 1.3.0, usethis 1.5.1, xtable 1.8-4
  • Loaded via a namespace (and not attached): acepack 1.4.1, annotate 1.64.0, AnnotationDbi 1.48.0, assertthat 0.2.1, backports 1.1.5, base64enc 0.1-3, bit 1.1-15.2, bit64 0.9-7, bitops 1.0-6, blob 1.2.1, broom 0.5.5, callr 3.4.3, cellranger 1.1.0, checkmate 2.0.0, cli 2.0.2, cluster 2.1.0, colorspace 1.4-1, compiler 3.6.3, crayon 1.3.4, data.table 1.12.8, DBI 1.1.0, dbplyr 1.4.2, desc 1.2.0, digest 0.6.25, ellipsis 0.3.0, evaluate 0.14, fansi 0.4.1, foreign 0.8-75, Formula 1.2-3, fs 1.4.0, geneplotter 1.64.0, generics 0.0.2, GenomeInfoDbData 1.2.2, glue 1.3.2, grid 3.6.3, gridExtra 2.3, gtable 0.3.0, haven 2.2.0, Hmisc 4.4-0, hms 0.5.3, htmlTable 1.13.3, htmltools 0.4.0, htmlwidgets 1.5.1, httr 1.4.1, jpeg 0.1-8.1, jsonlite 1.6.1, knitr 1.28, lattice 0.20-38, latticeExtra 0.6-29, lifecycle 0.2.0, locfit 1.5-9.4, lubridate 1.7.4, magrittr 1.5, Matrix 1.2-18, memoise 1.1.0, modelr 0.1.6, munsell 0.5.0, nlme 3.1-144, nnet 7.3-12, packrat 0.5.0, pillar 1.4.3, pkgbuild 1.0.6, pkgconfig 2.0.3, pkgload 1.0.2, png 0.1-7, prettyunits 1.1.1, processx 3.4.2, ps 1.3.2, R6 2.4.1, RColorBrewer 1.1-2, Rcpp 1.0.4, RCurl 1.98-1.1, readxl 1.3.1, remotes 2.1.1, reprex 0.3.0, rlang 0.4.5, rmarkdown 2.1, rpart 4.1-15, rprojroot 1.3-2, RSQLite 2.2.0, rstudioapi 0.11, rvest 0.3.5, scales 1.1.0, sessioninfo 1.1.1, splines 3.6.3, stringi 1.4.6, survival 3.1-8, testthat 2.3.2, tidyselect 1.0.0, tools 3.6.3, vctrs 0.2.4, withr 2.1.2, xfun 0.12, XML 3.99-0.3, xml2 1.3.0, XVector 0.26.0, yaml 2.2.1, zlibbioc 1.32.0

Parameter values used for this analysis are:

  • workDir: /Users/robert/Documents/School/Advanced Data Analysis/rob_han/Project03/SARTools/SARTools_edgeR.genes
  • projectName: SARTools.edgeR.genes
  • author: Robert Han
  • targetFile: ../genes.target.txt
  • rawDir: ../
  • featuresToRemove: NULL
  • varInt: Treatment
  • condRef: Untreated
  • batch: NULL
  • alpha: 0.05
  • pAdjustMethod: BH
  • cpmCutoff: 1
  • gene.selection: pairwise
  • normalizationMethod: TMM
  • colors: #f3c300, #875692, #f38400, #a1caf1, #be0032, #c2b280, #848482, #008856, #e68fac, #0067a5, #f99379, #604e97

Bibliography

1. R Core Team. R: A language and environment for statistical computing. Vienna, Austria : R Foundation for Statistical Computing, 2017 :

2. Gentleman RC, Carey VJ, Bates DM et al. Bioconductor: Open software development for computational biology and bioinformatics. Genome Biology 2004 ; 5: R80.

3. Robinson M, McCarthy D, Smyth G. EdgeR: A bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics 2010 ; 26: 139.

4. Robinson M, Smyth G. Moderated statistical tests for assessing differences in tag abundance. Bioinformatics 2007 ; 23: 2881.

5. Robinson M, Smyth G. Small-sample estimation of negative binomial dispersion, with applications to sage data. Biostatistics 2008 ; 9: 321.

6. McCarthy D, Chen Y, Smyth G. Differential expression analysis of multifactor rna-seq experiments with respect to biological variation. Nucleic Acids Research 2012 ; 40: 4288.

7. Dillies M-A, Rau A, Aubert J et al. A comprehensive evaluation of normalization methods for illumina high-throughput rna sequencing data analysis. Briefings in Bioinformatics 2013 ; 14: 671.

8. Schulze SK, Kanwar R, Gölzenleuchter M et al. SERE: Single-parameter quality control and sample comparison for rna-seq. BMC Genomics 2012 ; 13: 524.

9. Benjamini Y, Hochberg Y. Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society. Series B (Methodological) 1995 ; 57: 289–300.

10. Benjamini Y, Yekutieli D. The control of the false discovery rate in multiple testing under dependency. The Annals of Statistics 2001 ; 29: 1165–1188.